﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizControl.Library.BusinessObjects.Marks;
using System.Windows.Data;

namespace BizControl.Presentation.ActivityEditModule.Converters
{
  public class ConditionTypeToStringConverter : IValueConverter
  {
    #region IValueConverter Members

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      if (value != null)
      {
        var val = (ConditionType)Enum.Parse(typeof(ConditionType), value.ToString());
        if (val == ConditionType.ActivityRequired) return Properties.Resources.ActivityCondition;
        if (val == ConditionType.MarkRequired) return Properties.Resources.ActivityMarkCondition;
        if (val == ConditionType.SkillRequired) return Properties.Resources.PersonMarkCondition;
      }
      return false;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      return null;
    }

    #endregion
  }

}
